﻿<%@ Page Title="" Language="C#" MasterPageFile="~/DeveloperSite.Master" AutoEventWireup="true" 
    CodeBehind="Process_Indicators.aspx.cs" 
    Inherits="AmkeniCrossLoginApplication.Amkeni_System.CO.Process_Indicators"
    MaintainScrollPositionOnPostback="true" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">

    <asp:EntityDataSource ID="EntityDataSource1" runat="server" ConnectionString="name=Amkeni_DatabaseEntities" 
        DefaultContainerName="Amkeni_DatabaseEntities" EnableDelete="True" EnableFlattening="False" 
        EnableInsert="True" EnableUpdate="True" EntitySetName="indicators" Where="it.indicator_type_id = 2">
    </asp:EntityDataSource>

    <asp:EntityDataSource ID="IPEntityDataSource" runat="server" ConnectionString="name=Amkeni_DatabaseEntities" 
        DefaultContainerName="Amkeni_DatabaseEntities" EnableDelete="True" EnableFlattening="False" 
        EnableInsert="True" EnableUpdate="True" EntitySetName="indicators" Where="it.indicator_type_id = 2"
        OnQueryCreated="IPEntityDataSource_QueryCreated">
    </asp:EntityDataSource>

    <div style="height: 2em;">
        <div style="float: left;">
            <asp:Label ID="ContextLabel" runat="server" Text="PROCESS INDICATORS" CssClass="ContentHead"></asp:Label>
        </div>
    </div>

    <% if (User.IsInRole("Administrator"))
       { %>
    <asp:GridView ID="GridView2" runat="server" DataSourceID="EntityDataSource1"
        AutoGenerateColumns="False" DataKeyNames="indicator_id" CssClass="NewGrid" ShowFooter="true"
        AllowSorting="true">
        <AlternatingRowStyle CssClass="NewGridAlt" />
        <Columns>
            <asp:BoundField DataField="indicator_id" HeaderText="ID" ReadOnly="True" SortExpression="process_indicator_id" Visible="true"></asp:BoundField>
            <asp:TemplateField HeaderText="Process Indicator" SortExpression="name">
                <EditItemTemplate>
                    <asp:TextBox runat="server" Text='<%# Bind("name") %>' ID="TextBox1" TextMode="MultiLine"
                        Height="70px" Width="200px" CssClass="MText"></asp:TextBox>
                </EditItemTemplate>
                <ItemTemplate>
                    <asp:Label runat="server" Text='<%# Bind("name") %>' ID="Label1"></asp:Label>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="Baseline" SortExpression="baseline">
                <EditItemTemplate>
                    <asp:TextBox runat="server" Text='<%# Bind("baseline") %>' ID="TextBox2" TextMode="MultiLine"
                        Height="70px" Width="200px" CssClass="MText"></asp:TextBox>
                </EditItemTemplate>
                <ItemTemplate>
                    <asp:Label runat="server" Text='<%# Bind("baseline") %>' ID="Label2"></asp:Label>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="Target" SortExpression="target">
                <EditItemTemplate>
                    <asp:TextBox runat="server" Text='<%# Bind("target") %>' ID="TextBox3" TextMode="MultiLine"
                        Height="70px" Width="200px" CssClass="MText"></asp:TextBox>
                </EditItemTemplate>
                <ItemTemplate>
                    <asp:Label runat="server" Text='<%# Bind("target") %>' ID="Label3"></asp:Label>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="Data Source" SortExpression="data_source">
                <EditItemTemplate>
                    <asp:TextBox runat="server" Text='<%# Bind("data_source") %>' ID="TextBox4" TextMode="MultiLine"
                        Height="70px" Width="200px" CssClass="MText"></asp:TextBox>
                </EditItemTemplate>
                <ItemTemplate>
                    <asp:Label runat="server" Text='<%# Bind("data_source") %>' ID="Label4"></asp:Label>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="Method Of Collection" SortExpression="method_of_collection">
                <EditItemTemplate>
                    <asp:TextBox runat="server" Text='<%# Bind("method_of_collection") %>' ID="TextBox5" TextMode="MultiLine"
                        Height="70px" Width="200px" CssClass="MText"></asp:TextBox>
                </EditItemTemplate>
                <ItemTemplate>
                    <asp:Label runat="server" Text='<%# Bind("method_of_collection") %>' ID="Label5"></asp:Label>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="Collection Tools" SortExpression="collection_tools">
                <EditItemTemplate>
                    <asp:TextBox runat="server" Text='<%# Bind("collection_tools") %>' ID="TextBox6" TextMode="MultiLine"
                        Height="70px" Width="200px" CssClass="MText"></asp:TextBox>
                </EditItemTemplate>
                <ItemTemplate>
                    <asp:Label runat="server" Text='<%# Bind("collection_tools") %>' ID="Label6"></asp:Label>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="Assumptions and Risks" SortExpression="assumptions_and_risks">
                <EditItemTemplate>
                    <asp:TextBox runat="server" Text='<%# Bind("assumptions_and_risks") %>' ID="TextBox7" TextMode="MultiLine"
                        Height="70px" Width="200px" CssClass="MText"></asp:TextBox>
                </EditItemTemplate>
                <ItemTemplate>
                    <asp:Label runat="server" Text='<%# Bind("assumptions_and_risks") %>' ID="Label7"></asp:Label>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="Means Of Verification" SortExpression="means_of_verification">
                <EditItemTemplate>
                    <asp:TextBox runat="server" Text='<%# Bind("means_of_verification") %>' ID="TextBox8" TextMode="MultiLine"
                        Height="70px" Width="200px" CssClass="MText"></asp:TextBox>
                </EditItemTemplate>
                <ItemTemplate>
                    <asp:Label runat="server" Text='<%# Bind("means_of_verification") %>' ID="Label8"></asp:Label>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:CommandField ShowEditButton="true" ButtonType="Button" HeaderText="EDIT" />
        </Columns>
        <FooterStyle CssClass="NewGridFooter" />
    </asp:GridView>
    <% }
       else
       { %>
    <asp:GridView ID="GridView1" runat="server" DataSourceID="IPEntityDataSource"
        AutoGenerateColumns="False" DataKeyNames="indicator_id" CssClass="NewGrid" ShowFooter="true"
        AllowSorting="true">
        <AlternatingRowStyle CssClass="NewGridAlt" />
        <Columns>
            <asp:BoundField DataField="indicator_id" HeaderText="ID" ReadOnly="True" SortExpression="indicator_id" Visible="true"></asp:BoundField>
            <asp:TemplateField HeaderText="Process Indicator" SortExpression="name">
                <EditItemTemplate>
                    <asp:TextBox runat="server" Text='<%# Bind("name") %>' ID="TextBox1" TextMode="MultiLine"
                        Height="70px" Width="200px" CssClass="MText"></asp:TextBox>
                </EditItemTemplate>
                <ItemTemplate>
                    <asp:Label runat="server" Text='<%# Bind("name") %>' ID="Label1"></asp:Label>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="Baseline" SortExpression="baseline">
                <EditItemTemplate>
                    <asp:TextBox runat="server" Text='<%# Bind("baseline") %>' ID="TextBox2" TextMode="MultiLine"
                        Height="70px" Width="200px" CssClass="MText"></asp:TextBox>
                </EditItemTemplate>
                <ItemTemplate>
                    <asp:Label runat="server" Text='<%# Bind("baseline") %>' ID="Label2"></asp:Label>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="Target" SortExpression="target">
                <EditItemTemplate>
                    <asp:TextBox runat="server" Text='<%# Bind("target") %>' ID="TextBox3" TextMode="MultiLine"
                        Height="70px" Width="200px" CssClass="MText"></asp:TextBox>
                </EditItemTemplate>
                <ItemTemplate>
                    <asp:Label runat="server" Text='<%# Bind("target") %>' ID="Label3"></asp:Label>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="Data Source" SortExpression="data_source">
                <EditItemTemplate>
                    <asp:TextBox runat="server" Text='<%# Bind("data_source") %>' ID="TextBox4" TextMode="MultiLine"
                        Height="70px" Width="200px" CssClass="MText"></asp:TextBox>
                </EditItemTemplate>
                <ItemTemplate>
                    <asp:Label runat="server" Text='<%# Bind("data_source") %>' ID="Label4"></asp:Label>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="Method Of Collection" SortExpression="method_of_collection">
                <EditItemTemplate>
                    <asp:TextBox runat="server" Text='<%# Bind("method_of_collection") %>' ID="TextBox5" TextMode="MultiLine"
                        Height="70px" Width="200px" CssClass="MText"></asp:TextBox>
                </EditItemTemplate>
                <ItemTemplate>
                    <asp:Label runat="server" Text='<%# Bind("method_of_collection") %>' ID="Label5"></asp:Label>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="Collection Tools" SortExpression="collection_tools">
                <EditItemTemplate>
                    <asp:TextBox runat="server" Text='<%# Bind("collection_tools") %>' ID="TextBox6" TextMode="MultiLine"
                        Height="70px" Width="200px" CssClass="MText"></asp:TextBox>
                </EditItemTemplate>
                <ItemTemplate>
                    <asp:Label runat="server" Text='<%# Bind("collection_tools") %>' ID="Label6"></asp:Label>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="Assumptions and Risks" SortExpression="assumptions_and_risks">
                <EditItemTemplate>
                    <asp:TextBox runat="server" Text='<%# Bind("assumptions_and_risks") %>' ID="TextBox7" TextMode="MultiLine"
                        Height="70px" Width="200px" CssClass="MText"></asp:TextBox>
                </EditItemTemplate>
                <ItemTemplate>
                    <asp:Label runat="server" Text='<%# Bind("assumptions_and_risks") %>' ID="Label7"></asp:Label>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="Means Of Verification" SortExpression="means_of_verification">
                <EditItemTemplate>
                    <asp:TextBox runat="server" Text='<%# Bind("means_of_verification") %>' ID="TextBox8" TextMode="MultiLine"
                        Height="70px" Width="200px" CssClass="MText"></asp:TextBox>
                </EditItemTemplate>
                <ItemTemplate>
                    <asp:Label runat="server" Text='<%# Bind("means_of_verification") %>' ID="Label8"></asp:Label>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:CommandField ShowEditButton="true" ButtonType="Button" HeaderText="EDIT" />
        </Columns>
        <FooterStyle CssClass="NewGridFooter" />
    </asp:GridView>
    <% } %>
</asp:Content>
